package cn.edu.ldu.protocol;

import cn.edu.ldu.modules.controller.ChatMemberController;
import cn.edu.ldu.modules.entity.ChatMemberEntity;
import cn.edu.ldu.modules.entity.FriendsEntity;
import cn.edu.ldu.modules.entity.GroupChatEntity;
import cn.edu.ldu.modules.entity.UserAccountEntity;
import cn.edu.ldu.util.Consts;
import cn.edu.ldu.util.L;
import cn.edu.ldu.views.modules.controller.UserController;
import com.alibaba.fastjson.JSONObject;

import java.util.List;

public class GetChatMember {

    public GetChatMember(Protocol protocol){


        try {
            List<ChatMemberEntity> list = ChatMemberController.getChatMember(Long.valueOf(protocol.getData()), protocol.getToken());
            protocol.setData(JSONObject.toJSONString(list));
            protocol.setKey(Consts.P_CHAT_MEMBER);
            UserController.sendDataToUser(protocol);

        } catch (Exception e) {
            e.printStackTrace();
        }

    }

}
